package org.smile.design.proxy.cglib;

import net.sf.cglib.proxy.Enhancer;

public class Application {
    public static void main(String[] args) {
        Ship target = new Ship();
        Enhancer enhancer = new Enhancer();
        enhancer.setSuperclass(target.getClass());
        enhancer.setCallback(new Jarnvid(target));
        Ship ship = (Ship) enhancer.create();
        ship.enter();

        System.out.println("==========================");
        Enhancer enhancer1 = new Enhancer();
        enhancer1.setSuperclass(Ship.class);
        enhancer1.setCallback(new Asgard());
        Ship ship1 = (Ship) enhancer1.create();
        ship1.enter();

        System.out.println("==========================");
        Enhancer enhancer2 = new Enhancer();
        enhancer2.setSuperclass(Ship.class);
        enhancer2.setCallback(new Midgard(target));
        Ship ship2 = (Ship) enhancer2.create();
        ship2.enter();

    }
}
